<template>
    <div class="yorha-tab-btn-con">
        <div :class="{'inner':true, 'active':isActive}">
            <div class="pointer-con">
                <img src="../../assets/icons/point.png">
            </div>
            <div class="btn-con">
                <div class="swing top"></div>
                <div class="swing bottom"></div>
                <button>
                    <div class="little-box"></div>
                    <div class="text">
                        <slot></slot>
                    </div>
                </button>
            </div>
        </div>
    </div>
</template>

<script>
export default {
    name: "YorhaTabButton",
    props:['isActive']
}
</script>

<script setup>

</script>

<style lang="less" scoped>
@import "../../style";
.yorha-tab-btn-con {
    display: inline-block;
    width: 230px;
    height: 66px;
    &>.inner {
        width: 230px;
        height: 66px;
        display: flex;
        &.active {
            &:hover {
                &>.btn-con {
                    & > .swing {
                        &.top {
                            top: 6px;
                        }
                    }
                }
            }

            &>.pointer-con {
                &>img {
                    opacity: 1;
                }
            }

            &>.btn-con {
                & > .swing {
                    &.top {
                        top: 6px;
                    }

                    &.bottom {
                        top: 49px;
                    }
                }

                & > button {
                    height: 60px;
                    & > .little-box {
                        background: @white;
                    }

                    & > .text {
                        color: @white;
                    }

                    &::before {
                        width: 170px;
                        height: 60px;
                    }
                }
            }
        }

        &:hover {
            &>.pointer-con {
                &>img {
                    opacity: 1;
                }
            }

            &>.btn-con {
                & > .swing {
                    &.top {
                        top: 0;
                    }

                    &.bottom {
                        top: 49px;
                    }
                }

                & > button {
                    & > .little-box {
                        background: @white;
                    }

                    & > .text {
                        color: @white;
                    }

                    &::before {
                        width: 170px;
                    }
                }
            }
        }

        &>.pointer-con {
            width: 60px;
            height: 66px;
            box-sizing: border-box;
            padding: 6px 0 20px 0;
            display: flex;
            align-items: center;
            &>img {
                padding: 15px;
                width: 40px;
                height: 40px;
                opacity: 0;
            }
        }
        &>.btn-con {
            width: 170px;
            height: 66px;
            position: relative;

            &>.swing {
                position: absolute;
                width: 170px;
                height: 3px;
                left: 0;
                background: @darkGray;
                transition: top 200ms ease-in-out;
                &.top {
                    top: 6px;
                }
                &.bottom {
                    top: 40px;
                }
            }
            &>button {
                position: absolute;
                width: 170px;
                height: 40px;
                background: @darkYellow;
                border: none;
                outline: none;
                top: 6px;
                display: flex;
                padding: 0;
                transition: height 200ms ease-in-out;
                &>.little-box {
                    width: 20px;
                    height: 20px;
                    margin: 10px;
                    background: @darkGray;
                    z-index: 1;
                }
                &>.text {
                    width: auto;
                    height: 20px;
                    padding: 10px 0;
                    font-size: 20px;
                    color: @darkGray;
                    display: flex;
                    align-items: center;
                    z-index: 1;
                }
                &::before {
                    content: '';
                    position: absolute;
                    width: 0;
                    height: 40px;
                    transition: all 200ms ease-in-out;
                    background: @darkGray;
                    z-index: 0;
                }
            }
        }
    }
}
</style>